package cn.com.vrv.mapper;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import cn.com.vrv.entity.RecognitionModel;
import cn.com.vrv.entity.RecognitionTask;

/**
 * <一句话功能简述>
 *  
 * @author  赵炎
 * @version  [V1.00, 2017年11月21日]
 * @see  [相关类/方法]
 * @since V1.00
 */
public interface RecognitionModelMapper extends JpaRepository<RecognitionModel, Long>
													,JpaSpecificationExecutor<RecognitionModel> 
{
	@Query("select t from RecognitionModel t where t.modelId = ?1")
	RecognitionModel findByModelId(Long modelId);
	
	@Transactional
	@Modifying
	@Query("delete from RecognitionModel t where t.modelId = ?1")
	void deleteByModelId(Long modelId);
	
	@Transactional
	@Modifying
	@Query("update RecognitionModel t set t.modelName =?1,t.modelPath =?2,t.modelType =?3, t.modelDescription =?4 where t.modelId =?5")
	void updateByModelId(String modelName,String modelPath,String modelType,String  modelDescription,Long ModelId);
}
